# coding:utf-8
from pywinauto.application import Application
import time

tool_name = "notepad.exe"
window_name = u"无标题 - 记事本"
help_about = u"帮助->关于记事本"
edit = "Edit"
button1 = u'确定'
file_quit = u'文件->退出'
text = u"pywinauto works 哈哈!"
time.sleep(2)
button_no_save = u'不保存'

app = Application().start(tool_name)
app[window_name].menu_select(help_about)
app[window_name].Maximize()
app[help_about][button1].click()
app[window_name][edit].type_keys(text, with_spaces = True)
app[window_name].menu_select(file_quit)
app[u'记事本'][button_no_save].click()
# print dir(app)